#ifndef PROPEXTRACTORVIEWER_H
#define PROPEXTRACTORVIEWER_H

#include <QtGui/QMainWindow>
#include "ui_PropExtractorViewer.h"

#include "PropExtractor.h"

void QStringToWChar(wchar_t** a_Dst, QString& a_Src);

class PropExtractorViewer : public QMainWindow
{
	Q_OBJECT

public:

	static PropExtractorViewer& Get();

	void LoadFromPath(QString a_File);
	void ParseCommandArguments(QStringList& a_List);

public slots:

	void on_btnBrowse_pressed();

	void on_treFolder_itemClicked(QTreeWidgetItem* a_Item, int a_Column);
	void on_treFolder_itemSelectionChanged();

	void on_actLoadFromDirectory_triggered(bool a_Checked = false);
	void on_actLoadFromArchive_triggered(bool a_Checked = false);

	void LoadRecentFile();

	bool IsSafeMode();

private:

	void resizeEvent(QResizeEvent* a_Event);
	void closeEvent(QCloseEvent* a_Event);

protected:

	PropExtractorViewer(QWidget *parent = 0, Qt::WFlags flags = 0);
	~PropExtractorViewer();

	static PropExtractorViewer* s_Instance;

	void UpdateTree(QTreeWidgetItem* a_Item, int a_Column = 0);
	void LoadFromArchiveDialog();
	void AddRecentPath(QString a_Path);
	void WriteRecentPaths();
	
	WidgetImage* m_WidgetImage;
	WidgetTree* m_WidgetTree;

	QString m_WorkingDir;
	QMenu* m_MenuRecent;
	QStringList m_ListRecentPaths;
	QList<QAction*> m_ListMenuActions;
	QList<QAction*> m_ListRecentActions;

	Ui::PropExtractorViewerClass ui;
};

#endif // PROPEXTRACTORVIEWER_H
